<?php
require dirname(__FILE__).'/config.php';

require WP_VERSION_PATH . '/library/tokenizer.php';
require WP_VERSION_PATH . '/library/version_writer.php';

if(true === USE_SQLITE)
{
	require WP_VERSION_PATH . '/library/sqlite_save.php';
}
else if(true === USE_MYSQL)
{
	require WP_VERSION_PATH . '/library/mysql_save.php';
}

require WP_VERSION_PATH.'/header.php';

$wpversion = new WP_Version_Implementation(false);
$wpversion->setup();

function view_min_max_table($wpversion, $type)
{
?>
<table cellpadding="0" cellspacing="2" width="100%" border="0">
	<thead>
		<tr>
			<th style="text-align: left;">Name</th>
			<th>Min</th>
			<th>Max</th>
		</tr>
	</thead>
	<tbody>
<?php

foreach($wpversion->getTypeNamesWithVersions($type) as $row) :
	$min = false;
	$max = false;
	
	if( $row['version_0_71'] == 1 )
	{
		$min = '0.71';
	}
	else if( $row['version_1_0_0'] == 1 )
	{
		$min = '1.0.0';
	}
	else if( $row['version_1_0_1'] == 1 )
	{
		$min = '1.0.1';
	}
	else if( $row['version_1_0_2'] == 1 )
	{
		$min = '1.0.2';
	}
	else if( $row['version_1_2_0'] == 1 )
	{
		$min = '1.2.0';
	}
	else if( $row['version_1_2_1'] == 1 )
	{
		$min = '1.2.1';
	}
	else if( $row['version_1_2_2'] == 1 )
	{
		$min = '1.2.2';
	}
	else if( $row['version_1_5_0'] == 1 )
	{
		$min = '1.5.0';
	}
	else if( $row['version_1_5_1'] == 1 )
	{
		$min = '1.5.1';
	}
	else if( $row['version_1_5_2'] == 1 )
	{
		$min = '1.5.2';
	}
	else if( $row['version_2_0_0'] == 1 )
	{
		$min = '2.0.0';
	}
	else if( $row['version_2_0_1'] == 1 )
	{
		$min = '2.0.1';
	}
	else if( $row['version_2_0_4'] == 1 )
	{
		$min = '2.0.4';
	}
	else if( $row['version_2_0_5'] == 1 )
	{
		$min = '2.0.5';
	}
	else if( $row['version_2_0_6'] == 1 )
	{
		$min = '2.0.6';
	}
	else if( $row['version_2_0_7'] == 1 )
	{
		$min = '2.0.7';
	}
	else if( $row['version_2_0_8'] == 1 )
	{
		$min = '2.0.8';
	}
	else if( $row['version_2_0_9'] == 1 )
	{
		$min = '2.0.9';
	}
	else if( $row['version_2_0_10'] == 1 )
	{
		$min = '2.0.10';
	}
	else if( $row['version_2_0_11'] == 1 )
	{
		$min = '2.0.11';
	}
	else if( $row['version_2_1_0'] == 1 )
	{
		$min = '2.1.0';
	}
	else if( $row['version_2_1_1'] == 1 )
	{
		$min = '2.1.1';
	}
	else if( $row['version_2_1_2'] == 1 )
	{
		$min = '2.1.2';
	}
	else if( $row['version_2_1_3'] == 1 )
	{
		$min = '2.1.3';
	}
	else if( $row['version_2_2_0'] == 1 )
	{
		$min = '2.2.0';
	}
	else if( $row['version_2_2_1'] == 1 )
	{
		$min = '2.2.1';
	}
	else if( $row['version_2_2_2'] == 1 )
	{
		$min = '2.2.2';
	}
	else if( $row['version_2_2_3'] == 1 )
	{
		$min = '2.2.3';
	}
	else if( $row['version_2_3_0'] == 1 )
	{
		$min = '2.3.0';
	}
	else if( $row['version_2_3_1'] == 1 )
	{
		$min = '2.3.1';
	}
	else if( $row['version_2_3_2'] == 1 )
	{
		$min = '2.3.2';
	}
	else if( $row['version_2_3_3'] == 1 )
	{
		$min = '2.3.3';
	}
	else if( $row['version_2_5_0'] == 1 )
	{
		$min = '2.5.0';
	}
	else if( $row['version_2_5_1'] == 1 )
	{
		$min = '2.5.1';
	}
	else if( $row['version_2_6_0'] == 1 )
	{
		$min = '2.6.0';
	}

	if( $row['version_2_6_0'] == 1 )
	{
		$max = '2.6.0';
	}
	else if( $row['version_2_5_1'] == 1 )
	{
		$max = '2.5.1';
	}
	else if( $row['version_2_5_0'] == 1 )
	{
		$max = '2.5.0';
	}
	else if( $row['version_2_3_3'] == 1 )
	{
		$max = '2.3.3';
	}
	else if( $row['version_2_3_2'] == 1 )
	{
		$max = '2.3.2';
	}
	else if( $row['version_2_3_1'] == 1 )
	{
		$max = '2.3.1';
	}
	else if( $row['version_2_3_0'] == 1 )
	{
		$max = '2.3.0';
	}
	else if( $row['version_2_2_3'] == 1 )
	{
		$max = '2.2.3';
	}
	else if( $row['version_2_2_2'] == 1 )
	{
		$max = '2.2.2';
	}
	else if( $row['version_2_2_1'] == 1 )
	{
		$max = '2.2.1';
	}
	else if( $row['version_2_2_0'] == 1 )
	{
		$max = '2.2.0';
	}
	else if( $row['version_2_1_3'] == 1 )
	{
		$max = '2.1.3';
	}
	else if( $row['version_2_1_2'] == 1 )
	{
		$max = '2.1.2';
	}
	else if( $row['version_2_1_1'] == 1 )
	{
		$max = '2.1.1';
	}
	else if( $row['version_2_1_0'] == 1 )
	{
		$max = '2.1.0';
	}
	else if( $row['version_2_0_11'] == 1 )
	{
		$max = '2.0.11';
	}
	else if( $row['version_2_0_10'] == 1 )
	{
		$max = '2.0.10';
	}
	else if( $row['version_2_0_9'] == 1 )
	{
		$max = '2.0.9';
	}
	else if( $row['version_2_0_8'] == 1 )
	{
		$max = '2.0.8';
	}
	else if( $row['version_2_0_7'] == 1 )
	{
		$max = '2.0.7';
	}
	else if( $row['version_2_0_6'] == 1 )
	{
		$max = '2.0.6';
	}
	else if( $row['version_2_0_5'] == 1 )
	{
		$max = '2.0.5';
	}
	else if( $row['version_2_0_4'] == 1 )
	{
		$max = '2.0.4';
	}
	else if( $row['version_2_0_1'] == 1 )
	{
		$max = '2.0.1';
	}
	else if( $row['version_2_0_0'] == 1 )
	{
		$max = '2.0.0';
	}
	else if( $row['version_1_5_2'] == 1 )
	{
		$max = '1.5.2';
	}
	else if( $row['version_1_5_1'] == 1 )
	{
		$max = '1.5.1';
	}
	else if( $row['version_1_5_0'] == 1 )
	{
		$max = '1.5.0';
	}
	else if( $row['version_1_2_2'] == 1 )
	{
		$max = '1.2.2';
	}
	else if( $row['version_1_2_1'] == 1 )
	{
		$max = '1.2.1';
	}
	else if( $row['version_1_2_0'] == 1 )
	{
		$max = '1.2.0';
	}
	else if( $row['version_1_0_2'] == 1 )
	{
		$max = '1.0.2';
	}
	else if( $row['version_1_0_1'] == 1 )
	{
		$max = '1.0.1';
	}
	else if( $row['version_1_0_0'] == 1 )
	{
		$max = '1.0.0';
	}
	else if( $row['version_0_71'] == 1 )
	{
		$max = '0.71';
	}
?>
	<tr>
		<td><?php echo $row['info_name']; ?></td>
		<td style="text-align: center;"><?php echo $min; ?></td>
		<td style="text-align: center;"><?php if( $max != '2.6.0' ) : ?><strong><?php endif; ?><?php echo $max; ?><?php if( $max != '2.6.0' ) : ?></strong><?php endif; ?></td>
	</tr>
<?php endforeach; ?>
	</tbody>
</table>
<?php
}

?>

<h3>Functions</h3>

<?php view_min_max_table($wpversion, WP_Version_Tokenizer::TYPE_FUNCTION); ?>

<h3>Classes</h3>

<?php view_min_max_table($wpversion, WP_Version_Tokenizer::TYPE_CLASS); ?>

<h3>Methods</h3>

<?php view_min_max_table($wpversion, WP_Version_Tokenizer::TYPE_METHOD); ?>

<h3>Properties</h3>

<?php view_min_max_table($wpversion, WP_Version_Tokenizer::TYPE_PROPERTY); ?>

<?php require WP_VERSION_PATH.'/footer.php'; ?>